package edu.biwu;

import jakarta.servlet.*;

import java.io.IOException;

/*新建一个Java类，需要实现jakarta.servlet.Servlet接口
只有实现这个Servlet接口，才能说明它是一个服务端小程序，将来可以处理用户请求
* */
public class ServletDemo01 implements Servlet {
    @Override
    public void init(ServletConfig config) throws ServletException {

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        System.out.println("Hello Servlet");
        res.getWriter().write("<font color='red'>Servlet</font>");
    }

    @Override
    public String getServletInfo() {
        return "";
    }

    @Override
    public void destroy() {

    }
}
